package org.juc.eightlock;

import java.util.concurrent.TimeUnit;

public class Phone{
    public synchronized  void sendEmail(){
        try {
            // 暂停4秒钟，模拟编写邮件内容
            TimeUnit.SECONDS.sleep(4);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("----------sendEmail");
    }
    public synchronized void sendSMS(){
        System.out.println("----------sendSMS");
    }
    public void hello(){
        System.out.println("----------hello");
    }
}
